/**
 * Bakalarska prace - Inteligentni budik
 * @package sleepCatcher
 * @file FormSessionDelete.h
 * @author Jan Pesava - xpesav00
 * @email xpesav00@stud.fit.vutbr.cz
 * @date 24. 12. 2011
 */

#ifndef FORMSESSIONDELETE_H_
#define FORMSESSIONDELETE_H_

#include <FBase.h>
#include <FUi.h>
#include <FUiCtrlIListViewItemEventListener.h>
#include <FUiCtrlIListViewItemProvider.h>

using namespace Osp::Base;
using namespace Osp::Ui::Controls;
using namespace Osp::Base::Collection;

class FormSessionDelete :
	public Osp::Ui::Controls::Form,
	public Osp::Ui::IActionEventListener,
	public Osp::Ui::Controls::IListViewItemEventListener,
	public Osp::Ui::Controls::IListViewItemProvider
{

// Construction
public:
	FormSessionDelete();
	virtual ~FormSessionDelete();

// Constants
	static const int IDA_SESSION_DELETE = 200;
	static const int IDA_SESSION_BACK 	= 201;
// Attributes
	ArrayList* pSessionsList;
	ListView* pSessionsListView;
// Methods
public:
	bool Initialize(void);
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
	virtual void OnListViewContextItemStateChanged (Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListContextItemStatus status);
	virtual void OnListViewItemLongPressed (Osp::Ui::Controls::ListView &listView, int index, int elementId, bool &invokeListViewItemCallback);
	virtual void OnListViewItemStateChanged (Osp::Ui::Controls::ListView &listView, int index, int elementId, Osp::Ui::Controls::ListItemStatus status);
	virtual void OnListViewItemSwept (Osp::Ui::Controls::ListView &listView, int index, Osp::Ui::Controls::SweepDirection direction);
	virtual Osp::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
	virtual bool DeleteItem(int index, Osp::Ui::Controls::ListItemBase* pItem, int itemWidth);
	virtual int GetItemCount(void);
	void LoadAllSessions();
	void DeleteSessions();
	int GetFormId();
	void Update();
	void Redraw();
};

#endif /* FORMSESSIONDELETE_H_ */
